-
-
Notifications
You must be signed in to change notification settings - Fork 94
Implement automatic reconnection for Google PubSub subscription #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement automatic reconnection for Google PubSub subscription #477
Conversation
michalnarwojsz-abax
commented
Nov 28, 2025
•
edited by qodo-free-for-open-source-projects
bot
Loading
edited by qodo-free-for-open-source-projects
bot
In case Google PubSub subscription encounters an unrecoverable error, perform normal connection dropped handling: call the OnDropped callback and try to reconnect.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
Test Results 51 files + 34 51 suites +34 31m 53s ⏱️ + 21m 7s Results for commit 97efc6a. ± Comparison against base commit 57b538b. This pull request removes 5 and adds 15 tests. Note that renamed tests count towards both. |
|
Thank you for merging! Could some pre-release NuGet version be published with the fix included, so that we can reference it in our project? |
|
All merged code is published as packages. It's on myget. Check the readme, it should be there |
Perfect, thank you! |
User description
In case Google PubSub subscription encounters an unrecoverable error, perform normal connection dropped handling: call the OnDropped callback and try to reconnect.
Auto-created Ticket
#478
PR Type
Enhancement
Description
Add automatic reconnection handling for Google PubSub subscription failures
Monitor subscriber task for unrecoverable errors and dropped connections
Call OnDropped callback with appropriate reason on subscription termination
Ensure proper cleanup of monitor task during unsubscribe
Diagram Walkthrough
flowchart LR A["Subscribe starts<br/>_subscriberTask"] --> B["MonitorSubscriberTask<br/>monitors task"] B --> C{"Task completes<br/>or fails?"} C -->|Normal completion| D["Dropped callback<br/>DropReason.Stopped"] C -->|Unrecoverable error| E["Dropped callback<br/>DropReason.ServerError"] C -->|Cancellation| F["Expected shutdown"] D --> G["Reconnection triggered"] E --> GFile Walkthrough
GooglePubSubSubscription.cs
Add subscriber task monitoring and error handlingsrc/GooglePubSub/src/Eventuous.GooglePubSub/Subscriptions/GooglePubSubSubscription.cs
_monitorTaskfield to track the monitoring task lifecycleMonitorSubscriberTaskmethod to handle subscriber taskcompletion and failures
Subscribemethod after startingsubscriber
Unsubscribemethod to properly await and clean up the monitortask
and unrecoverable errors